package com.foreknow.demo2;

/**
 * 二维数组: 数组的数组
 * int[][] array = new int[3][3];
 * int[][] array = new int[][]{{1,2,3},{4,5,6},{7,8,9}};
 * int[][] arr = {{1,2,3},{4,5,6},{7,8,9}};
 */
public class ArrayDemo4 {
    public static void main(String[] args) {
        //初始化二维数组
        int[][] arr = {{1,2,3},{4,5,6},{7,8,9}};
        //二维数组的遍历
        for(int i = 0;i < arr.length;i++) { //遍历一维
            for(int j = 0;j < arr[i].length;j++) {
                System.out.println(arr[i][j]);
            }
        }
    }
}
